package thread;

class MyRunnable implements Runnable{

    @Override
    public void run() {
        System.out.println(" hello runnable ");
    }
}

public class Demo2 {
    public static void main(String[] args) {
        Runnable runnable = new MyRunnable();
        Thread t = new Thread(runnable); //runnable描述了的话,就直接把对象传过去,new的是Thread库
        t.start();
    }
}